using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Inventory
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("库存管理")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("库存调拨")]
  public partial class InventoryTransfer : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private System.String _remark;
    private System.String _transferringReason;
    private System.DateTime _transferringDate;
    private Ascent.QiPei.Module.BusinessObjects.Base.Employee _employee;
    private Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore _importShopStore;
    private Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore _exportShopStore;
    private System.String _fTRCode;
    public InventoryTransfer(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("单号")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String FTRCode
    {
      get
      {
        return _fTRCode;
      }
      set
      {
        SetPropertyValue("FTRCode", ref _fTRCode, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("调出店铺")]
    [RuleRequiredField(DefaultContexts.Save)]
    public Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore ExportShopStore
    {
      get
      {
        return _exportShopStore;
      }
      set
      {
          SetPropertyValue("ExportShopStore", ref _exportShopStore, value);
        //if (_exportShopStore == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore prevExportShopStore = _exportShopStore;
        //_exportShopStore = value;
        //if (IsLoading)
        //  return;
        //if (prevExportShopStore != null && prevExportShopStore.InventoryTransfer == this)
        //  prevExportShopStore.InventoryTransfer = null;
        //if (_exportShopStore != null)
        //  _exportShopStore.InventoryTransfer = this;
        //OnChanged("ExportShopStore");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("调入店铺")]
    [RuleRequiredField(DefaultContexts.Save)]
    public Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore ImportShopStore
    {
      get
      {
        return _importShopStore;
      }
      set
      {
          SetPropertyValue("ImportShopStore", ref _importShopStore, value);
        //if (_importShopStore == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore prevImportShopStore = _importShopStore;
        //_importShopStore = value;
        //if (IsLoading)
        //  return;
        //if (prevImportShopStore != null && prevImportShopStore.InventoryTransfer == this)
        //  prevImportShopStore.InventoryTransfer = null;
        //if (_importShopStore != null)
        //  _importShopStore.InventoryTransfer = this;
        //OnChanged("ImportShopStore");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("仓管员")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Employee Employee
    {
      get
      {
        return _employee;
      }
      set
      {
          SetPropertyValue("Employee", ref _employee, value);
        //if (_employee == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Employee prevEmployee = _employee;
        //_employee = value;
        //if (IsLoading)
        //  return;
        //if (prevEmployee != null && prevEmployee.InventoryTransfer == this)
        //  prevEmployee.InventoryTransfer = null;
        //if (_employee != null)
        //  _employee.InventoryTransfer = this;
        //OnChanged("Employee");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("调拨日期")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.DateTime TransferringDate
    {
      get
      {
        return _transferringDate;
      }
      set
      {
        SetPropertyValue("TransferringDate", ref _transferringDate, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("调拨原因")]
    public System.String TransferringReason
    {
      get
      {
        return _transferringReason;
      }
      set
      {
        SetPropertyValue("TransferringReason", ref _transferringReason, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remark
    {
      get
      {
        return _remark;
      }
      set
      {
        SetPropertyValue("Remark", ref _remark, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("InventoryTransferItemses-InventoryTransfer")]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("明细")]
    public XPCollection<Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryTransferItems> InventoryTransferItemses
    {
      get
      {
        return GetCollection<Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryTransferItems>("InventoryTransferItemses");
      }
    }
  }
}
